<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
	<META NAME="AUTHOR" CONTENT="kejin">
	<META NAME="CREATED" CONTENT="20070529;10350290">
	<META NAME="CHANGEDBY" CONTENT="kejin">
	<META NAME="CHANGED" CONTENT="20070605;21045500">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.5in 11in; margin: 0.79in }
		P { margin-bottom: 0.08in }
		H2 { color: #000000 }
		H3 { color: #000000 }
		PRE { color: #000000 }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H2>PocoCapsule/C++ DSM example: Robotic Vehicle</H2>
<P>Copyright(c) 2006 by <A HREF="http://www.pocomatic.com/">Pocomatic
Software</A>. All rights reserved.</P>
<P>This example illustrates a robotic vehicle motion control
application assembled using PocoCapsule/C++ IoC and DSM from
following seven components:</P>
<UL>
	<LI><P><FONT SIZE=2>Two ServoComponent: the left and right wheels </FONT>
	</P>
	<LI><P><FONT SIZE=2>Two BumperSensorComponent: the front and rear
	bumper</FONT></P>
	<LI><P><FONT SIZE=2>A VehicleController: the central motion
	controller</FONT></P>
	<LI><P><FONT SIZE=2>A RangerScannerComponent: the laser range finder</FONT></P>
	<LI><P><FONT SIZE=2>A LogAndDisplayComponent: logger and display
	status.</FONT></P>
</UL>
<P><I>Note: A OMG RTC version of this example can be found in the
<A HREF="../../corba/jtrs-sca/README.html">${POCOCAPSULE_DIR}/examples/corba/rtc</A>
directory. </I>
</P>
<P>These components are implemented as plain old C++ objects (POCOs)
and are instantiated and wired up using the PocoCapsule/C++ IoC
Container according to the <A HREF="setup.xml">setup.xml</A>
description. The assembled motion application is illustrated in the
following diagram: 
</P>
<H3><A HREF="rtc.jpg"><IMG SRC="rtc.jpg" NAME="RTC.JPG" ALIGN=LEFT WIDTH=552 HEIGHT=394 BORDER=0><BR CLEAR=LEFT></A>Source
Files</H3>
<P><A HREF="main.C">main.C:</A> This is a mini
container, used by PocoCapsule/C++ to assemble/deploy this RTC
application. 
</P>
<P><A HREF="ServoComponent.h">ServoComponent.h</A>
and <A HREF="ServoComponent.C">ServoComponent.C:</A>
The implementation of ServoComponent. 
</P>
<P><FONT COLOR="#000000"><A HREF="BumperSensorComponent.h">BumperSensorComponent.h</A>
and <A HREF="BumperSensorComponent.C">BumperSensorComponent.C:</A>
The implementation of BumperSensorComponent. </FONT>
</P>
<P><FONT COLOR="#000000"><A HREF="RangeScannerComponent.h"><FONT SIZE=3>RangeScannerComponent.h</FONT></A><FONT SIZE=2>
<FONT SIZE=3>and </FONT><A HREF="RangeScannerComponent.C"><FONT SIZE=3>RangeScannerComponent.C:</FONT></A>
</FONT><FONT SIZE=3>The implementation of laser
RangeScannerComponent. </FONT></FONT>
</P>
<P><FONT COLOR="#000000"><A HREF="VehicleController.h"><FONT SIZE=3>VehicleController.h</FONT></A><FONT SIZE=2>
<FONT SIZE=3>and </FONT><A HREF="VehicleController.C"><FONT SIZE=3>VehicleControl.C:</FONT></A>
</FONT><FONT SIZE=3>The implementation of VehicleController. </FONT></FONT>
</P>
<P><A HREF="objImpls.h">objImpls.h</A>: provides
inline implementation of the LogAndDisplay component and ports of
above components.</P>
<P><A HREF="setup.xml">setup.xml:</A> This is the
application context described the setup of this RTC application.</P>
<P><A HREF="robotic-application.dtd">robotic-application.dtd</A>:
This is the document type definition specifying the domain-specific-modelling (DSM) schema. 
</P>
<P><I><FONT COLOR="#000000"><A HREF="robotic-application2poco.xsl">robotic-application2poco.xsl</A>:
This is the DSM schema to the core schema of PocoCapsule/C++
transformation stylesheet. </FONT></I>
</P>
<H3>Building this example</H3>
<P STYLE="font-weight: medium">To build this example, the environment
variable POCOCAPSULE_DIR should point to the PocoCapsule/C++
installed directory. Then, this example can be built by simply
invoking gmake/make on linux/unix or nmake on windows. 
</P>
<H3>Running this example</H3>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">Before
starting <FONT FACE="Times New Roman">the application deployment
container (i.e. the main executable)</FONT>, make sure the
LD_LIBRARY_PATH (on linux and solaris) or the PATH (on windows)
environment variable is set correctly to include the
${POCOCAPSULE_DIR}/lib directory.</FONT></P>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">start
the main executable: </FONT>
</P>
<PRE STYLE="margin-left: 0.79in; margin-bottom: 0.2in"><FONT FACE="Courier 10 Pitch"><FONT SIZE=2 STYLE="font-size: 11pt"><B>prompt&gt;</B> main </FONT></FONT></PRE><P STYLE="margin-bottom: 0.2in">
<FONT FACE="Times New Roman">It will display the following component
instantiation and wiring operations made during the assembling:</FONT></P>
<PRE STYLE="font-weight: medium"><FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The ControlIn reference of the left wheel servo is injected into the LeftWheelControlOut port of the vehicle controller</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The ControlIn reference of the right wheel servo is injected into the RightWheelControlOut port of the vehicle controller</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The ControlIn reference of the laser ranger scanner is injected into the ScanCommandOut port of the vehicle controller</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The log and display is injected into the StatusOut port of the vehicle controller</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The LeftWheelDataIn sink reference of the vehicle controller is injected into the SpeedDataOut port of the left wheel servo</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The RightWheelDataIn sink reference of the vehicle controller is injected into the SpeedDataOut port of the right wheel servo</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The FrontBumperDataIn sink reference of the vehicle controller is injected into the BumperDataOut port of the front bumper sensor</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The RearBumperDataIn sink reference of the vehicle controller is injected into the BumperDataOut port of the rear bumper sensor</FONT></FONT>
<FONT FACE="Times New Roman"><FONT SIZE=2>[wire]: The RangeScanDataIn sink reference of the vehicle controller is injected into the RangeScanDataOut port of the laser ranger scanner</FONT></FONT>
</PRE><P STYLE="margin-bottom: 0.2in">
<A HREF="../../README.html"><FONT FACE="Times New Roman">Back to the
root page</FONT></A></P>
</BODY>
</HTML>
